home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
lib
/
udev
/
check-ptp-camera
< prev
next >
Wrap
Text File
|
2008-09-23
|
497b
|
21 lines
#!/bin/bash
# check if any interface of this device is a PTP camera interface (06)
INTERFACE="${1:-06/01/01}"
BASENAME=${PHYSDEVPATH##*/}
for d in /sys/${PHYSDEVPATH}/${BASENAME}:*; do
[[ -d ${d} ]] || continue
INTERFACEID="$(< ${d}/bInterfaceClass)"
INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceSubClass)"
INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceProtocol)"
#echo ${d}: ${INTERFACEID}
if [[ ${INTERFACE} == ${INTERFACEID} ]]; then
# Found interface
exit 0
fi
done
exit 1